<!DOCTYPE html>
<?php $this->load->helper('url'); ?>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"  lang="sr-RS"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>HR application • Dynamint</title>
        <meta name="description" content="HR application">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />
        <!-- Styles -->
        <link rel="stylesheet" href="<?php echo base_url() ?>css/uikit.min.css">
        <link rel="stylesheet" href="<?php echo base_url() ?>css/main.css">
        <link rel="stylesheet" href="<?php echo base_url() ?>css/responsive.css">

        <script src="<?php echo base_url() ?>js/vendor/modernizr-2.6.2.min.js"></script>
    </head>
    <body>
        <!--[if lt IE 7]>
            <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
        <![endif]-->
        <div class="pristup">
            <div class="uk-badge">administrator</div><br/>
            <div class="uk-badge uk-badge-success">supervizor</div><br/>
            <div class="uk-badge uk-badge-warning">korisnik</div>
        </div>
        <div id="top">
            <div class="uk-container uk-container-center">
                
                <div class="uk-grid">
                    <div class="uk-width-1-4 logo">
                        <div class="uk-width-1-1 "><span>merit</span> plan</div>
                        <div class="uk-width-1-1 logosmall">upravljanje ljudskim resursima<br /> i organizacioni razvoj</div>
                    </div>
                    <div class="uk-width-2-4 uk-text-center"><h2>Registracija</h2><p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr</p></div>
                    <div class="uk-width-1-4">
                        <div class="uk-grid uk-text-right usertop">
                            <div class="uk-width-3-4">Registracija
                                <div class="useruloga">
                                    <div class="">molimo Vas prijavite se</div>
                                </div>
                            </div>
                            <div class="uk-width-1-4 uk-text-center"><span class="uk-icon-user"></span></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    <div id="menu">     
        <div class="uk-container uk-container-center">
      
            <nav class="uk-navbar">
                <ul class="uk-navbar-nav">
                    <li class="uk-active"><a href="<?php echo base_url() ?>humanresources/registracija" class="uk-navbar-nav-subtitle">Registracija<div>strana3</div></a></li>
                </ul>
                <div class="uk-navbar-flip">
                    <ul class="uk-navbar-nav">
                        <li><a href="<?php echo base_url() ?>">Home</a></li>
                        
                     </ul>
                </div>
            </nav>
        </div>
    </div>
        <div id="main">
            <div class="uk-container uk-container-center">
            
            <div class="uk-grid">
                <div class="uk-width-3-4">
                
                    <div class="uk-panel uk-panel-box">
                        <h3 class="uk-panel-title"><i class="uk-icon-user"></i> Registracija</h3>
                        <form class="uk-form uk-form-horizontal" method="post" action="<?php echo base_url(); ?>humanresources/userRegister">
                        <div class="uk-grid">
                                <div class="uk-width-1-2">
                                    <legend>Osnovni podaci</legend>
                                    <div class="uk-form-row">
                                        <label class="uk-form-label" for="form-ime">Ime</label>
                                        <div class="uk-form-controls">
                                        <?php if (form_error('first_name')): ?>
                                        <div class="uk-alert uk-alert-danger" data-uk-alert>
                                            <a href="" class="uk-alert-close uk-close"></a>
                                            <?php echo form_error('first_name'); ?>
                                        </div>
                                        <?php endif ?>
                                            <input type="text" id="form-ime" placeholder="Text input"  name="first_name" value="<?php echo set_value('first_name'); ?>">
                                        </div>
                                    </div>
                                    <div class="uk-form-row">
                                        <label class="uk-form-label" for="form-prezime">Prezime</label>
                                        <div class="uk-form-controls">
                                        <?php if (form_error('last_name')): ?>
                                        <div class="uk-alert uk-alert-danger" data-uk-alert>
                                            <a href="" class="uk-alert-close uk-close"></a>
                                            <?php echo form_error('last_name'); ?>
                                        </div>
                                        <?php endif ?>
                                            <input type="text" id="form-prezime" placeholder="Text input"  name="last_name" value="<?php echo set_value('last_name'); ?>">
                                        </div>
                                    </div>
                                    <div class="uk-form-row">
                                        <label class="uk-form-label" for="form-username">Korisničko ime</label>
                                        <div class="uk-form-controls">
                                        <?php if (form_error('user_name')): ?>
                                        <div class="uk-alert uk-alert-danger" data-uk-alert>
                                            <a href="" class="uk-alert-close uk-close"></a>
                                            <?php echo form_error('user_name'); ?>
                                        </div>
                                        <?php endif ?>    
                                            <input type="text" id="form-username" placeholder="Text input"  name="user_name"  value="<?php echo set_value('user_name'); ?>">
                                        </div>
                                    </div>
                                    <div class="uk-form-row">
                                        <label class="uk-form-label" for="form-password">Lozinka</label>
                                        <div class="uk-form-controls">
                                        <?php if (form_error('password')): ?>
                                        <div class="uk-alert uk-alert-danger" data-uk-alert>
                                            <a href="" class="uk-alert-close uk-close"></a>
                                            <?php echo form_error('password'); ?>
                                        </div>
                                        <?php endif ?>
                                            <input type="password" id="form-password" placeholder="Password input"  name="password"  value="<?php echo set_value('password'); ?>">
                                        </div>
                                    </div>
                                </div>
                                <div class="uk-width-1-2">
                                    <legend>Vaša kompanija</legend>
                                    
                                    <div class="uk-form-row">
                                        <select  name="company_id" id="firma">
                                            <option value="">Izaberi Kompaniju</option>
                                            <?php foreach ($companies as $company): ?>
                                            <option id="<?php echo $company->id;  ?>" value="<?php echo $company->id;  ?>"><?php echo 
                                            $company->company_name;  ?></option>
                                            <?php endforeach;  ?>  
                                        </select>
                                    </div>
                                     <?php if (form_error('company_id')): ?>
                                    <div class="uk-alert uk-alert-danger" data-uk-alert>
                                        <a href="" class="uk-alert-close uk-close"></a>
                                        <?php echo form_error('company_id'); ?>
                                    </div> 
                                    <?php endif ?>      
                                    <div class="uk-form-row">
                                        <legend class="lsek">Sektor</legend>
                                        <?php echo form_error('user_sektor'); ?>
                                        <select id="sektori" name="sector_id">
                                            <option class="difolt" value="<?php echo set_value('sector_id'); ?>"></option>
                                        </select>
                                    </div>

                                </div>
                            </div>
                            <div class="uk-grid">
                                <div class="uk-width-1-2">
                                    <legend>Status</legend>    
                                    <div class="uk-form-row">
                                        <select id="user_level"  name="user_level">
                                            <option type="text" value="0">Registrovan</option>
                                            
                                            <?php if ($user[0]->user_level==3): ?>
                                            <option type="text"  value="1">Korisnik</option>
                                            <option type="text" value="2">Supervizor</option>
                                            <option type="text" value="3">Administrator</option>
                                            <?php endif; ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="uk-width-1-2">
                                    <legend>Info</legend>    
                                    <div class="uk-form-row">
                                        <div>
                                            <p>Nakon registracije Administrator će Vam odobriti nalog.</p>
                                            <p>Aplikaciju možete koristiti samo ako Vam je nalog odobren.</p>
                                        </div>
                                    </div> 
                                </div>
                            </div>
                            <hr>
                            <div class="uk-form-row">
                                <button type="submit" class="uk-button  uk-button-primary">Registracija</button>
                            </div>

                        </form>

                    </div>
                </div>
                <div class="uk-width-1-4">
                    <div class="uk-panel uk-panel-box">
                        <h3 class="uk-panel-title"><i class="uk-icon-info-circle"></i> Informacije</h3>
                        <p>Uputstvo ili objašnjenje</p>
                        <hr>
                        <article class="uk-panel uk-panel-box uk-panel-box-secondary">
                            <div class="uk-panel-badge uk-badge uk-badge-success">info</div>
                            <h3 class="uk-panel-title">Naslov</h3>
                            <p>Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Ut wisi enim ad minim veniam</p>
                        </article> 
                        <article class="uk-panel uk-panel-box uk-panel-box-secondary">
                            <div class="uk-panel-badge uk-badge uk-badge-danger">bitno</div>
                            <h3 class="uk-panel-title">Naslov</h3>
                            <p>Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Ut wisi enim ad minim veniam,</p>
                        </article>   
                    </div>
                </div>
            </div>
        </div>
        </div>    
        <div id="futer">
            <div class="uk-container uk-container-center uk-text-center">
 Merit Plan &copy; 2013 
            </div>
        </div>
        <!-- Scripts -->
        <script src="<?php echo base_url() ?>js/vendor/jquery-1.10.2.min.js"></script>
        <script src="<?php echo base_url() ?>js/vendor/uikit.min.js"></script>
        <script src="<?php echo base_url() ?>js/plugins.js"></script>
        <script src="<?php echo base_url() ?>js/main.js"></script>
        <script type="text/javascript">
            var url = "<?php echo base_url() ?>humanresources/ajaxSectors"
            $( "#firma" ).change(function() {
                firma = $('#firma').find(":selected").attr('value');
                $.ajax({
                    url: url,
                    type: 'POST',
                    data: { firma: firma}
                })
                .done(function(reply) {
                    $("#sektori").html(reply);
                })
                .fail(function(reply) {
                    console.log("error");
                });
                $('.difolt').remove();
            });
            $('.dodaj-sektor option').each(function(index, el) {
                if ($(this).text() == 'NULL') {
                    $(this).remove();
                };
            });
            
        </script>
        <!-- Google Analytics -->

    </body>
</html>
